package cn.com.pagoda.ideplugin.common.transcoder;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

/**
 * @Author xieluxin
 * @Date 2023/7/9 11:16
 * @Version 1.0
 */
@FunctionalInterface
public interface ForwardTranscodeFunction {


    /**
     * 正向转换(编码/加密/计算哈希)函数
     *
     * @param text 原内容
     * @param key 秘钥key, 不需要可以传null
     * @return 编码/加密/计算哈希后的值
     */
    String forwardTranscode(String text,String key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException;
}